package hijava;

public class Main {
    public static void main(String[] args) {
        System.out.println("生产者和消费者的问题");
        Storage15 storage = new Storage15();
        new Thread(new ConsumerRunnable(storage),"消费者1").start();
//        new Thread(new ConsumerRunnable(storage),"消费者2").start();

        new Thread(new ProducerRunnable(storage),"生产者1").start();
        new Thread(new ProducerRunnable(storage),"生产者2").start();
        new Thread(new ProducerRunnable(storage),"生产者3").start();
        new Thread(new ProducerRunnable(storage),"生产者4").start();

    }
}
/*
1. 定义一个仓库，有 add()   和 subtract() 同步方法
2. 消费和生产者都是线程



* */


